package com.cfec.educationplatform.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import lombok.Data;

/**
 * 用户练习历史记录表
 * @TableName tb_pra_history
 */
@TableName(value ="tb_pra_history")
@Data
public class TbPraHistory {
    /**
     * id
     */
    @TableId
    private Long historyId;

    /**
     * 科目:0:数学;1:物理;2:化学;3:英语
     */
    private String historySubjects;

    /**
     * 题目数量
     */
    private Long hisTopicNum;

    /**
     * 该次练习得分
     */
    private Long historyScore;

    /**
     * 该次练习用时
     */
    private Long hisUseTime;

    /**
     * 该条历史的日期：年月日：格式：‘“YYYY-MM-DD”
     */
    private Date historyDate;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 信息状态：0：弃用，1：使用
     */
    private String historyState;

    /**
     * 年级：小学x年级(e_x，x为1到6)；
初中x年级（j_x，x为1到3）；
高中x年级（h_x，x为1到3);
大学x年级（u_x，x为1到4）
     */
    private String historyGrade;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TbPraHistory other = (TbPraHistory) that;
        return (this.getHistoryId() == null ? other.getHistoryId() == null : this.getHistoryId().equals(other.getHistoryId()))
            && (this.getHistorySubjects() == null ? other.getHistorySubjects() == null : this.getHistorySubjects().equals(other.getHistorySubjects()))
            && (this.getHisTopicNum() == null ? other.getHisTopicNum() == null : this.getHisTopicNum().equals(other.getHisTopicNum()))
            && (this.getHistoryScore() == null ? other.getHistoryScore() == null : this.getHistoryScore().equals(other.getHistoryScore()))
            && (this.getHisUseTime() == null ? other.getHisUseTime() == null : this.getHisUseTime().equals(other.getHisUseTime()))
            && (this.getHistoryDate() == null ? other.getHistoryDate() == null : this.getHistoryDate().equals(other.getHistoryDate()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getHistoryState() == null ? other.getHistoryState() == null : this.getHistoryState().equals(other.getHistoryState()))
            && (this.getHistoryGrade() == null ? other.getHistoryGrade() == null : this.getHistoryGrade().equals(other.getHistoryGrade()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getHistoryId() == null) ? 0 : getHistoryId().hashCode());
        result = prime * result + ((getHistorySubjects() == null) ? 0 : getHistorySubjects().hashCode());
        result = prime * result + ((getHisTopicNum() == null) ? 0 : getHisTopicNum().hashCode());
        result = prime * result + ((getHistoryScore() == null) ? 0 : getHistoryScore().hashCode());
        result = prime * result + ((getHisUseTime() == null) ? 0 : getHisUseTime().hashCode());
        result = prime * result + ((getHistoryDate() == null) ? 0 : getHistoryDate().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getHistoryState() == null) ? 0 : getHistoryState().hashCode());
        result = prime * result + ((getHistoryGrade() == null) ? 0 : getHistoryGrade().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", historyId=").append(historyId);
        sb.append(", historySubjects=").append(historySubjects);
        sb.append(", hisTopicNum=").append(hisTopicNum);
        sb.append(", historyScore=").append(historyScore);
        sb.append(", hisUseTime=").append(hisUseTime);
        sb.append(", historyDate=").append(historyDate);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", historyState=").append(historyState);
        sb.append(", historyGrade=").append(historyGrade);
        sb.append("]");
        return sb.toString();
    }
}